package com.weng.bigdata.core.mq.model;

import com.weng.bigdata.core.schedule.TaskStatusEnum;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 异步执行SQL的状态 实体
 * @author wengzhonghui
 * @date 2020/12/16 15:05
 */
@Data
public class MqExecuteScriptStatus {

    /**
     * 请求的客户端Id
     */
    private String clientId;

    private String taskId;

    /**
     * 见TaskStatusEnum.java
     */
    private Integer status;

    /**
     * 状态描述
     */
    private String statusText;

    private Long startTime;

    private Long endTime;

    /**
     * 脚本
     */
    private String script;

    /**
     * 错误日志
     */
    private String errorMsm;

    /**
     * 执行结果
     */
    private List<Map<String, Object>> result;

    public MqExecuteScriptStatus() {
    }

    public MqExecuteScriptStatus(String taskId, Integer status, Long startTime, String script) {
        this.taskId = taskId;
        this.status = status;
        this.startTime = startTime;
        this.script = script;
    }

    public MqExecuteScriptStatus(String taskId, Integer status, Long startTime, String script, String clientId) {
        this.taskId = taskId;
        this.status = status;
        this.startTime = startTime;
        this.script = script;
        this.clientId = clientId;

    }

    public MqExecuteScriptStatus(String taskId, Integer status, Long startTime, Long endTime, String errorMsm, List<Map<String, Object>> result) {
        this.taskId = taskId;
        this.status = status;
        this.startTime = startTime;
        this.endTime = endTime;
        this.errorMsm = errorMsm;
        this.result = result;
    }
}
